#pragma once
#include "D3D12DeviceWrapper.h"

using namespace DirectX;
using namespace DirectX::SimpleMath;

class GameCanvas
{
private:
	CD3DX12_VIEWPORT m_viewport;
	CD3DX12_RECT m_scissorRect;
	Vector3 m_eye = { 2.f, 1.5f, -3.f };
	float m_angleH = 0;
	float m_angleV = 0;
	UINT64 count=0;
	D3D12DeviceWrapper* m_deviceWrapper;

	std::unique_ptr<GraphicsMemory> m_graphicsMemory;

	ComPtr<ID3D12GraphicsCommandList> m_commandList;
	ComPtr<ID3D12GraphicsCommandList> m_commandList1;
	ID3D12CommandQueue* m_commandQueue;
	ComPtr<ID3D12CommandAllocator> m_commandAllocator1;
	ComPtr<ID3D12CommandAllocator> m_commandAllocator;
	ID3D12PipelineState* m_pipelineState;
	ComPtr<ID3D12DescriptorHeap> m_dsvHeap;
	ID3D12DescriptorHeap* m_srvHeap;
	DirectX::SimpleMath::Matrix m_world;
	DirectX::SimpleMath::Matrix m_view;
	DirectX::SimpleMath::Matrix m_proj;
	std::unique_ptr<DirectX::CommonStates> m_states;
	std::unique_ptr<DirectX::EffectFactory> m_fxFactory;
	std::unique_ptr<DirectX::EffectTextureFactory> m_modelResources;
	std::unique_ptr<DirectX::EffectTextureFactory> m_modelResources1;
	std::unique_ptr<DirectX::Model> m_model;
	std::unique_ptr<DirectX::Model> m_model1;
	std::vector<std::shared_ptr<DirectX::IEffect>> m_modelNormal;
	std::vector<std::shared_ptr<DirectX::IEffect>> m_modelNormal1;

	void Reset();
public:
	static HWND hwnd;
	GameCanvas(HWND hwnd, int width, int height);
	~GameCanvas();
	void Render();
	void KeyDown(UINT8 key);
};

